// utils/dialog.js
import Dialog from '@vant/weapp/dialog/dialog';

let isDialogShowing = false; // 全局防抖标记

export function showConfirm(options, pageCtx) {
  if (isDialogShowing) return Promise.reject('Dialog 已显示');
  isDialogShowing = true;

  return Dialog.confirm({
    ...options,
    context: pageCtx
  })
    .finally(() => {
      isDialogShowing = false; // Dialog 关闭后重置
    });
}
